import request from '@/utils/request';

export async function query() {
  return request('/api/admin/user/list');
}

export async function queryCurrent() {
  return request('/api/admin/currentUser');
}

export async function queryPermission(){
  return request('/api/admin/permission/list');
}
export async function queryRole(){
  return request('/api/admin/role/list');
}
export async function queryPermissionFather(){
  return request('/api/admin/permission/father/list');
}
export async function queryUrl(){
  return request('/api/admin/url/list');
}

export async function updatePermission(params){
  return request('/api/admin/permission/update', {
    method: 'POST',
    body: params,
  });
}

export async function addPermission(params){
  return request('/api/admin/permission/add', {
    method: 'POST',
    body: params,
  });
}

export async function deletePermission(params){
  return request('/api/admin/permission/delete', {
    method: 'POST',
    body: params,
  });
}

export async function updateRole(params){
  return request('/api/admin/role/update', {
    method: 'POST',
    body: params,
  });
}

export async function addRole(params){
  return request('/api/admin/role/add', {
    method: 'POST',
    body: params,
  });
}

export async function deleteRole(params){
  return request('/api/admin/role/delete', {
    method: 'POST',
    body: params,
  });
}

export async function deleteUser(params){
  return request('/api/admin/user/delete', {
    method: 'POST',
    body: params,
  });
}

export async function updateUser(params){
  return request('/api/admin/user/update', {
    method: 'POST',
    body: params,
  });
}

export async function addUser(params){
  return request('/api/admin/user/add', {
    method: 'POST',
    body: params,
  });
}